#pragma once
#include <pthread.h>

class lockGuard
{
public:
    lockGuard(pthread_mutex_t *pmutex):_pmutex(pmutex)
    {
        pthread_mutex_lock(_pmutex);
    }
    ~lockGuard()
    {
        pthread_mutex_unlock(_pmutex);
    }

private:
    pthread_mutex_t *_pmutex;
};